import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: () => import('../views/Home.vue'),
    children:[
      {
        path: '/article/list',
        name: 'ArticleLlist',
        component: () => import('../views/ArticleList.vue'),
      },
      {
        path: '/article/edit/:id?',
        name: 'ArticleEdit',
        component: () => import('../views/ArticleEdit.vue'),
      }
    ]
  },
  {
    path:'/regist',
    name:'Regist',
    component:()=>import('../views/Regist')
  },
  {
    path:'/login',
    name:'Login',
    component:()=>import('../views/Login')
  }
]

const router = new VueRouter({
  routes
})

export default router
